{{template "component/base.html" .}}
{{define "head"}}
<title>Rank</title>
<style>
    body {
        background: url(/static/img/base.jpg) no-repeat center fixed;
        background-size: cover;
    }
</style>
{{end}}

{{define "body"}}
<div class="container">
    <div class="row">
        <div class="col-md-12" style="text-align: center;">
            <h1 style="color: beige;">排行榜</h1>
            <br>
            <table class="table table-dark table-hover">
                <thead>
                    <tr>
                        <th>排名</th>
                        <th>用户名</th>
                        <th>分数</th>
                    </tr>
                </thead>
                <tbody>
                    {{range $index, $elem := .UsersRank}}
                    <tr onclick="javascript:window.location.href='/user/{{$elem.Username}}'">
                        <td>{{addone $index}}</td>
                        <td >{{$elem.Username}}</td>
                        <td>{{$elem.Mark}}</td>
                    </tr>
                     {{end}}
                </tbody>
            </table>
        </div>
    </div>
</div>
{{end}}